package com.guiji.text2video.fastvideo.task;

import com.guiji.text2video.fastvideo.domain.vo.Text2videoJobScheduleStat;
import com.guiji.text2video.fastvideo.mapper.Text2videoJobScheduleStatMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @program: ruoyi 定时任务
 * @description:
 * @author: gaoX
 * @create: 2021-05-27 18:09
 **/
@Component("jobStatTimingTask")
public class JobStatTimingTask {
    @Autowired(required = false)
    Text2videoJobScheduleStatMapper text2videoJobScheduleStatMapper;

    //@Scheduled(cron = "0/60 * * * * *")
    public void upgradeJobScheduleStat() {

        List<Text2videoJobScheduleStat> list = text2videoJobScheduleStatMapper.scheduleJobStat();
        list.forEach(ele -> {
            text2videoJobScheduleStatMapper.insertText2videoJobScheduleStat(ele);
        });


    }
}
